﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;

namespace Medianamik.Core.Logging
{
   public class NLogLogger : ILogger
    {
       private string _loggerName;
       public NLogLogger(string pLoggerName)
       {
           _loggerName = pLoggerName ?? "*";
       } 

       public void Trace(string pMessage)
       {
           LogManager.GetLogger(_loggerName).Trace(pMessage);
       }
       public void Trace(string pMessage, Exception pException)
       {
           LogManager.GetLogger(_loggerName).TraceException(pMessage, pException); 
       }

       public void Debug(string pMessage)
       {
           LogManager.GetLogger(_loggerName).Debug(pMessage);
       }
       public void Debug(string pMessage, Exception pException)
       {
           LogManager.GetLogger(_loggerName).DebugException(pMessage, pException); 
       }

        public void Info(string pMessage)
        {
            LogManager.GetLogger(_loggerName).Info(pMessage);
        }
        public void Info(string pMessage, Exception pException)
        {
            LogManager.GetLogger(_loggerName).InfoException(pMessage, pException); 
        }

        public void Warn(string pMessage)
        {
            LogManager.GetLogger(_loggerName).Warn(pMessage);
        }
        public void Warn(string pMessage, Exception pException)
        {
            LogManager.GetLogger(_loggerName).WarnException(pMessage, pException); 
        }

        public void Error(string pMessage)
        {
            LogManager.GetLogger(_loggerName).Error(pMessage);
        }
        public void Error(string pMessage, Exception pException)
        {
            LogManager.GetLogger(_loggerName).ErrorException(pMessage, pException); 
        }

        public void Fatal(string pMessage)
        {
            LogManager.GetLogger(_loggerName).Fatal(pMessage);
        }
        public void Fatal(string pMessage, Exception pException)
        {
            LogManager.GetLogger(_loggerName).FatalException(pMessage, pException); 
        }

    }
}
